From ac62479c9ecceda406b110f0623ac6f031c352af Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 23 Sep 2015 23:24:36 +0800 Subject: [PATCH] Fix Visual Studio Build Since a080cb4 The patch did not check for Visual Studio 2008 correctly, plus it would break the build on later Visual Studio versions, as it should be __popcnt(), not __popcount(). Fix that. --- gtk/gtkcssselector.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c index f252bbc7b6..e987aa1292 100644 --- a/gtk/gtkcssselector.c +++ b/gtk/gtkcssselector.c @@ -25,9 +25,8 @@ #include "gtkcssprovider.h" #include "gtkstylecontextprivate.h" -#if defined(_MSC_VER) && _MSC_VER > 1500 +#if defined(_MSC_VER) && _MSC_VER >= 1500 # include -# define __builtin_popcount(n) __popcount(n) #endif typedef struct _GtkCssSelectorClass GtkCssSelectorClass; @@ -758,8 +757,8 @@ count_bits (guint n) return (guint) __builtin_popcount (n); #elif defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 1)) return (guint) __builtin_popcount (n); -#elif defined(_MSC_VER) && _MSC_VER > 1500 - return (guint) __builtin_popcount (n); +#elif defined(_MSC_VER) && _MSC_VER >= 1500 + return (guint) __popcnt (n); #else guint result = 0; -- 2.30.2